<style>
.bigbigbutton {
  margin-top: 100px;
}
</style>

<template>
  <div class="bigbigbutton">
    <mt-button type="danger" @click="clearAll">清空所有数据</mt-button>
  </div>
</template>
<script>
import api from '@/api/clearAll'
import { MessageBox } from 'mint-ui'
export default {
  methods: {
    clearAll () {
      MessageBox.prompt('请输入超级管理员密码').then(({ value, action }) => {
        if (value === '清除数据') {
          api.clearAll().then(resp => {
            alert(resp.message)
          })
        } else {
          alert('密码错误')
        }
      })
    }
  }
}
</script>
